<%# Copyright 2009 Swansea University

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
%>


<fieldset><legend>Login information</legend>

  <p>
    <%= f.label :login, "Login: " %>              <%= f.text_field :login %>
  </p>

  <p>
    <%= f.label :email, "Email address: " %>      <%= f.text_field :email %>
  </p>

  <p>
    <%= f.label  :password, "Password: " %><%= f.password_field :password %>
  </p>

  <p>
    <%= f.label :password_confirmation, "Confirm Password: " %>
    <%= f.password_field :password_confirmation %>
  </p>


  <p>
    <%= f.label :roles, "Assigned roles: " %> <%= show_roles(user) %>
  </p>
</fieldset>
<fieldset><legend>User details</legend>
  <p>
    <%= f.label :title, "Title: " %>           <%= f.select(:title, %w{ Mr Mrs Ms Dr Prof. } )%>
    <%= f.label :first_name, "First Name: " %> <%= f.text_field :first_name, :size=>"20" %>
    <%= f.label :initials, "Initials: " %>     <%= f.text_field :initials,  :size=>"5" %>
    <%= f.label :last_name, "Last Name: " %>   <%= f.text_field :last_name, :size=>"20" %>
  </p>
  <p>
    <%= f.label :known_as, "Known as: " %>    <%= f.text_field :known_as, :size=>"20" %>
  </p>

  <fieldset><legend>Assign roles to this user</legend>
    <%= collection_multiple_select('user', 'role_ids',
                Role.find(:all, :order => "name"),
                :id, :name,
                :outer_class => "multiple_select", :inner_class => "multiple_select_checkbox", :alternate => true ) %>
    <div id="staff_research_centre">
      <fieldset><legend>Staff details</legend>
        <% fields_for :supervisor do |staff| %>
          <%= render(:partial => "admin/supervisors/supervisor", :locals => {:f => staff, :staff => :supervisor}) %>
        <% end %>
      </fieldset>
    </div>
    <div id="student_discipline">
      <fieldset><legend>Student details</legend>
        <% fields_for :student do |student| %>
          <%= render(:partial => "admin/students/student", :locals => {:f => student, :student => :student}) %>
        <% end %>
      </fieldset>
    </div>
  </fieldset>

</fieldset>
